<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<head>
<style>
	td{
		min-width:25px;
		white-space:nowrap;
	}
</style>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 系统管理 <span class="c-gray en">&gt;</span> 系统日志 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>

<article class="page-container">
	<%--<div class="cl pd-5 bg-1 bk-gray">
		<!-- 搜索栏 -->
		<div class="row">
			<label class="form-label col-xs-1">标签:</label>
			<div class="formControls col-xs-3">
				<input type="text" class="input-text" id="lable" name="lable" />
			</div>
		</div>
		<div class="formControls col-xs-3 text-r">
			<a href="javascript:query();" class="btn btn-success radius"><i class="Hui-iconfont">&#xe665;</i> 查询</a>
			<a href="javascript:void(0);" onclick="reset(this)" class="btn btn-secondary radius"><i class="Hui-iconfont">&#xe665;</i> 重置</a>
		</div>
	</div>--%>
	<div class="mt-20" >
		<table class="table table-border table-bordered table-bg table-sort">
			<thead>
				<tr>
					<th width="25">序号</th>
					<th width="70">日志类型</th>
					<th width="70">日志标题</th>
					<th width="70">操作用户</th>
					<th width="70">操作者IP</th>
					<th width="70">用户代理信息</th>
					<%--<th>所在公司</th><th>所在部门</th>--%>
					<th width="70">URI</th>
					<th width="70">提交方式</th>
					<th width="70">提交的数据</th>
					<th width="70">响应</th>
					<th width="70">操作时间</th>
					<th width="600">错误信息</th>
				</tr>
			</thead>
			<%--<%request.setAttribute("strEnter", "\n");request.setAttribute("strTab", "\t");%>--%>
		</table>
	</div>
</article>
<script type="text/javascript">
var datatable = null;
$(function(){
	datatable = $('.table-sort').DataTable({
        pagingType: "input",
        "sScrollX": "100%",
        "sScrollXInner": "100%",
        "bScrollCollapse": true,
        ordering:false,
		ajax: {
			url: "${ctx}/sysLog/queryByPage",
			type: 'post',
			data: function(d) {
//                d.search_LIKE_lable=$('#lable').val();
            }
		},
		fnDrawCallback:function(oSettings){//表格画完的回调函数
			var obj = oSettings.json.otherData;
        },
		columns: [{
			"data": null,
			"class": "text-c",
			"render":function(data, type, row, meta){
				return  meta.row + 1;
			}
		},{
            "data": "type",
            "defaultContent": "",
            "class": "text-c",
            "render" : function (data, type, row, meta) {
                if(data == '1'){
                    return "接入日志";
				}else  if(data == '2'){
                    return "错误日志";
                }else{
				    return "其他";
				}
            }
        },{
            "data": "title",
            "defaultContent": "",
            "class": "text-c"
        },{
            "data": "createBy.nickName",
            "defaultContent": "",
            "class": "text-c"
        },{
            "data": "remoteAddr",
            "defaultContent": "",
            "class": "text-c"
        },{
            "data": "userAgent",
            "defaultContent": "",
            "class": "text-c"
        },{
            "data": "requestUri",
            "defaultContent": "",
            "class": "text-c"
        },{
            "data": "method",
            "defaultContent": "",
            "class": "text-c"
        },{
            "data": "params",
            "defaultContent": "",
            "class": "text-c"
        },{
            "data": "respos",
            "defaultContent": "",
            "class": "text-c"
        },{
            "data": "createDate",
            "defaultContent": "",
            "class": "text-c"
        },{
            "data": "exception",
            "defaultContent": "",
            "render":function(data, type, row, meta){
				var da = data.replace(/\n/g, "<br/>").replace(/\t/g, "&nbsp; &nbsp; ");
                return "<da style=\"display: none\">"+da+"</da><a href=\"javascript:void(0);\" onclick=\"openEx(this)\">查看</a>";
                <%--return  ${fn:replace(fn:replace(fns:escapeHtml('aa'), strEnter, '<br/>'), strTab,'&nbsp; &nbsp; ')};--%>
            }
        }],
		initComplete:function(data){


		}
	});
})
function openEx(ex){
    layer.open({
        type: 1,
        skin: 'layui-layer-rim', //加上边框
        area: ['1200px', '740px'], //宽高
        content: $(ex).parent().find("da")
    });
}

</script>
</body>
</html>